use std::rc::Rc;
use std::cell::RefCell;

fn main() {
    let n1 = Box::new(1024);
    println!("堆 - {}", n1);
    let n2 = Rc::new(1024);
    let n3 = Rc::clone(&n2);
    println!("n2 = {}, n3 = {}", n2, n3);
    println!("引用次数 = {}", Rc::strong_count(&n3));
    let n4 = RefCell::new(1024);
    // * - 解引用
    *n4.borrow_mut() = 1025;
    println!("n4 = {}", n4.borrow());
}
